package com.jye.rseven.user.mapper;

import com.jye.rseven.domain.Promotion;
import com.jye.rseven.domain.Sharing;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface SharingMapper {


    //根据id进行查询
    Sharing findSharingById(@Param("id") int id);

    //查询推广表所有数据
    List<Sharing> findAllSharing(@Param("skip")int skip, @Param("limit")int limit);

    //添加数据到推广表
    void addSharing(@Param("sharing") Sharing sharing);

    int updateSharing(@Param("sharing") Sharing sharing);


    //查询状态
    String findSharingStatusByuId(@Param("uId") int uId);

    //通过分享码进行查询
    Sharing findSharingByShareCode(@Param("shareCode") String shareCode);

    int isInSharing( @Param("uId") int uId,@Param("cId")int cId);

    String findShareCodeByuIdAndCId(@Param("uId") int uId,@Param("cId")int cId);
}
